//-----------------------------------------------------------------------
// <copyright file="TaskException.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
// </copyright>
// <author>Andy Reeves</author>
// <email>andyr</email>
// <date>2004-03-23</date>
// <summary>Generic TaskException used for wrapping other exceptions with more task specific
// information such as properties set on task.</summary>
//-----------------------------------------------------------------------

namespace Microsoft.Sdc.Tasks
{
    using System;
    /// <summary>
    /// Generic TaskException used for wrapping other exceptions with more task specific
    /// information such as properties set on task.
    /// </summary>
    public class TaskException : ApplicationException
    {
        private string[] values;
        private string resourceName;

        public string ResourceName
        {
            get { return this.resourceName; }
        }

        public string[] Values
        {
            get { return this.values; }
        }

        /// <summary>
        /// Initializes a new instance of the TaskException class.
        /// </summary>
        public TaskException(Exception e, string resourceName, params string[] values)
            : base(resourceName, e)
        {
            this.values = values;
            this.resourceName = resourceName;
        }

        /// <summary>
        /// Initializes a new instance of the TaskException class.
        /// </summary>
        public TaskException(string resourceName, params string[] values)
            : base(resourceName, null)
        {
            this.resourceName = resourceName;
            this.values = values;
        }

        /// <summary>
        /// Initializes a new instance of the TaskException class.
        /// </summary>
        public TaskException(string resourceName)
            : base(resourceName)
        {
            this.resourceName = resourceName;
            this.values = null;
        }

        /// <summary>
        /// Initializes a new instance of the TaskException class.
        /// </summary>
        public TaskException(Exception e, string resourceName)
            : base(resourceName, e)
        {
            this.resourceName = resourceName;
            this.values = null;
        }
    }
}
